package cn.iocoder.yudao.module.book.controller.admin.records.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import javax.validation.constraints.*;

@Schema(description = "管理后台 - 阅读记录新增/修改 Request VO")
@Data
public class RecordsSaveReqVO {

    @Schema(description = "记录id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26484")
    private Integer recordId;

    @Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "30640")
    @NotNull(message = "用户id不能为空")
    private Integer userId;

    @Schema(description = "绘本id", requiredMode = Schema.RequiredMode.REQUIRED, example = "960")
    @NotNull(message = "绘本id不能为空")
    private Integer bookId;

    @Schema(description = "绘本集id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32749")
    @NotNull(message = "绘本集id不能为空")
    private Integer collectionId;

    @Schema(description = "阅读日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "阅读日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @PastOrPresent(message = "阅读时间不能超过当前时间")
    private LocalDateTime readingDate;

    @Schema(description = "阅读数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "21704")
    @NotNull(message = "阅读数量不能为空")
    private Integer readingCount;

    @Schema(description = "阅读日志", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "阅读日志不能为空")
    private String readingNotes;

    @Schema(description = "阅读日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @NotNull(message = "阅读日期不能为空")
    @PastOrPresent(message = "阅读时间不能超过当前时间")
    private LocalDateTime updateTime;

    @Schema(description = "逻辑删除", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "逻辑删除不能为空")
    private Boolean deleted;

}